package com.jin.crud.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jin.crud.bean.QueryMenu;
import com.jin.crud.bean.SysMenu;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 菜单权限表 Mapper 接口
 * </p>
 *
 * @author yuxuejin
 * @since 2021-11-20
 */
public interface SysMenuMapper extends BaseMapper<SysMenu> {

    int insertMenu(SysMenu menu);

    int updateMenu(SysMenu menu);

    int deleteMenu(@Param("menuId") String menuId);

    List<SysMenu> selectMenuTreeAll();

    List<SysMenu> selectMenuTreeByUserId(String userId);

    List<SysMenu> selectMenuList(QueryMenu menu);

    List<SysMenu> selectMenuListByUserId(QueryMenu menu);

    SysMenu checkMenuNameUnique(@Param("menuName") String menuName, @Param("parentId") String parentId);

    int hasChildByMenuId(String menuId);

    List<String> selectMenuListByRoleId(@Param("roleId") String roleId, @Param("menuCheckStrictly") boolean menuCheckStrictly);

    List<String> selectMenuPermsByUserId(String userId);
}
